import VueRouter from 'vue-router'
import Vue from 'vue'
Vue.use(VueRouter)


// 引入对应的页面组件
import Home from '@/views/Home'
import Category from '@/views/Category'
import Cart from '@/views/Cart'
import Topic from '@/views/Topic'
import User from '@/views/User'


const router = new VueRouter({
    mode: 'history',   //路由模式history
    routes: [
        { path: '/', redirect: '/home' },
        { path: '/home', component: Home },
        { path: '/topic', component: Topic },
        { path: '/category', component: Category },
        { path: '/cart', component: Cart },
        { path: '/user', component: User },

    ]
})

export default router